<?php

namespace App\Validation;

use Phalcon\Validation\Validator\PresenceOf;
use Phalcon\Validation\Validator\Regex;

class SmsValidation extends BaseValidation
{
    public function initialize()
    {
        $this->add(
            "mobile",
            new PresenceOf(
                [
                    "message" => "The mobile is required",
                ]
            )
        );
		
		$this->add(
			"mobile",
			new Regex(
				[
					"message"    => "Mobilel format is not correct",
					"pattern"    => "/^1[34578]\d{9}$/",
					"allowEmpty" => true,
				]
			)
		);
		
		
    }
}